import requests
from lxml import etree

url="http://www.baidu.com"
response=requests.get(url=url)
response.encoding="utf-8"
with open("baidu.html","w",encoding="utf-8") as fp:
    fp.write(response.text)